package com.wanxi.util;

import java.util.Random;

public class MaxArray {
    public static void main(String[] args) {
        int[] arr = new int[30];
        setArray(arr);
        int max = getMaxNum(arr);
        System.out.println(max);
    }

    private static void setArray(int[] arr) {

        for (int i = 0; i < arr.length; i++) {
            arr[i] = new Random().nextInt(51) * 2;
        }

        System.out.println(11);

    }

    private static int getMaxNum(int[] arr) {
        int max = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (max < arr[i]) {
                max = arr[i];
            }
        }
        return max;
//        System.out.println(max);
    }

}
